import time
def sorthub(chisla):
    swat = True
    while swat:
        swat = False
        for i in range(len(chisla) -1):
            if chisla[1] > chisla[i + 1]:
                chisla[i], chisla[i + 1] = chisla[i + 1], chisla[i]
                swat = True

def greenfile(filename):
    file = open(filename, 'r')
    data = file.readlines()
    return data

m1 = greenfile('m1_sorted.txt')
m2 = greenfile('m2_reverse.txt')
m3 = greenfile('m3_shuffle.txt')

nachalo = time.time()
sorthub(m1)
konec = time.time()
print('m1_sorted', round((konec-nachalo)*1000),'milliseconds')

nachalo = time.time()
sorthub(m2)
konec = time.time()
print('m2_reverse', round((konec-nachalo)*1000),'milliseconds')

nachalo = time.time()
sorthub(m3)
konec = time.time()
print('m3_shuffle', round((konec-nachalo)*1000),'milliseconds')    
